<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 引入react核心库 -->
    <script type="text/javascript" src="../../js/react.development.js"></script>
    <!-- 用于支持react操作DOM -->
    <script type="text/javascript" src="../../js/react-dom.development.js"></script>
    <!-- 用于将jsx转为js -->
    <script type="text/javascript" src="../../js/babel.min.js"></script>
</head>
<body>
    <div id="title"></div>
    <div id="list"></div>

    <script type="text/babel">
        const myData = "前端列表"
        var namelist = ["Angular", "react", "vue"]
        var html =[]
        namelist.forEach((item,index)=>{
            html.push(<li key={index}>{item}</li>)
        })
        const VDOM = (
            <div>
                <h2>
                    <span>{myData}</span>
                </h2>
                <ul>
                    {
                        // namelist.map((item,index)=>{
                        //     return <li key={index}>{item}</li>
                        // })
                        html
                    }
                </ul>
            </div>
        )
        ReactDOM.render(VDOM,document.getElementById('title'))
    </script>
</body>
<style>
</style>
</html>